<%@ page language="java" pageEncoding="UTF-8"%><%@ include
	file="/WEB-INF/commons/taglibs.jsp"%>
<script type="text/javascript">
function showMsg($item, msgType, msg, timeout){
	var classType='ui-state-highlight';
	if(msgType=='error'){
		classType='ui-state-error';
	}
	$item.addClass(classType);
	$item.html("<span class='ui-icon ui-icon-info' style='float: left; margin-right: .3em;'></span>"+msg);
	setTimeout(function(){$item.html('').removeClass(classType);},timeout);
}
function query(){
	var key=jQuery.trim($('#key').val());
	if(key.length==0){
		showMsg($('#search-msg'),'error','请输入关键字',5000);
		return;
	}
	window.location.href="<c:url value='/search?'/>key="+encodeURIComponent(key);
}
function enterKey(){
	if(event.keyCode==13){query();}
}
$(function(){
	$('#key').focus();
	$('#search').button().click(function(){query();});
});
</script>
<div id="index">
<table>
	<tr>
		<td>
		<div id="left" class="xcenter"><img class="oto-flows"
			src="<c:url value="/images/oto-sharing-flows.png"/>" /></div>
		</td>
		<td>
		<div id="right">
		<div id="search-form"><input id="key" name="key"
			class="medium-input" onkeydown="enterKey();" />
		<button id="search" value="搜索">搜索电话</button>
		<div id="search-msg"></div>
		</div>
		<div class="top-border" style="min-height: 200px;">
		<p class="title">最新加入的用户</p>
		</div>
		<div class="top-border" style="min-height: 200px;">
		<p class="title">最新分享的电话</p>
		</div>
		</div>
		</td>
	</tr>
</table>
</div>